<?php
class AddressModel extends Model{
	private $table1 ='address';
	private $table2 = 'province';
	private $table3 = 'city';
	private $table4 = 'area';
	private $table5 = 'addressdetail';
	
	/**
	 * 获取收货地址列表
	 * @param $where 条件
	 */
	public function getAddress($where){
		/*  return M($this->table1)->table($this->table1." ad")->join($this->table2." p ON ad.provcode=p.code")->join($this->table3." c ON ad.citycode=c.code")->
		join($this->table4." a ON ad.area_id=a.code")->field('ad.*,p.name as prov_name,c.name as city_name, a.name as area_name')->where($where)->select();
		 *///echo M($this->table1)->getLastSql();die;
		return M($this->table5)->where($where)->find();
	}
}